package com.daotu.psy.admin.api.feign;

import com.daotu.psy.admin.api.dto.DeptUserCountDTO;
import com.daotu.psy.common.core.constant.SecurityConstants;
import com.daotu.psy.common.core.constant.ServiceNameConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Set;

/**
 * @author lengleng
 * @date 2018/6/22
 */
@FeignClient(contextId = "remoteDeptService", value = ServiceNameConstants.UPMS_SERVICE)
public interface RemoteDeptService {

	/**
	 * 通过部门列表获取部门下总人数
	 *
	 * @param deptIds 部门列表
	 * @param from    调用标志
	 * @return list
	 */
	@GetMapping("/inner/depts/user-count")
	List<DeptUserCountDTO> userCount(@RequestParam("deptIds") Set<Long> deptIds, @RequestHeader(SecurityConstants.FROM) String from);


}
